<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <title>Space Agent WebSocket Demo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <style>
    body {
      font-family: Arial, sans-serif;
      margin: 2em;
    }

    #log {
      border: 1px solid #ccc;
      height: 300px;
      overflow-y: auto;
      padding: 1em;
      margin-bottom: 1em;
      background: #f9f9f9;
    }

    #inputArea {
      display: flex;
      gap: 0.5em;
    }

    #userInput {
      flex: 1;
    }

    .ai {
      color: #1976d2;
    }

    .tool {
      color: #388e3c;
    }

    .error {
      color: #d32f2f;
    }
  </style>
</head>

<body>
  <h2>Space Agent WebSocket 双工通讯演示</h2>
  <div id="log"></div>
  <div id="inputArea">
    <input id="userInput" type="text" placeholder="请输入指令..." />
    <input id="threadId" type="text" placeholder="thread_id(可选)" style="width:160px" />
    <button id="sendBtn">发送</button>
  </div>
  <script type="module" src="main.js"></script>
</body>

</html>